a11y: Check before disconnecting selection signals
authorEmmanuele Bassi <ebassi@gnome.org>
Wed, 25 Nov 2020 18:13:54 +0000 (18:13 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Wed, 25 Nov 2020 18:13:54 +0000 (18:13 +0000)
If the selection data has already been cleared we should just bail out.

Fixes: #3404
gtk/a11y/gtkatspiselection.c

index 6bc501e57a5d4226e36c15453d24d9e52df9b1f4..adfdbf021ac8768be4acdd9dffe253c92974ffab 100644 (file)
@@ -1132,6 +1132,8 @@ gtk_atspi_disconnect_selection_signals (GtkAccessible *accessible)
       SelectionChanged *changed;
 
       changed = g_object_get_data (G_OBJECT (accessible), "accessible-selection-data");
+      if (changed == NULL)
+        return;
 
       g_signal_handlers_disconnect_by_func (accessible, changed->changed, changed->data);
 
@@ -1143,6 +1145,8 @@ gtk_atspi_disconnect_selection_signals (GtkAccessible *accessible)
       SelectionChanged *changed;
 
       changed = g_object_get_data (G_OBJECT (accessible), "accessible-selection-data");
+      if (changed == NULL)
+        return;
 
       g_signal_handlers_disconnect_by_func (notebook, changed->changed, changed->data);